package com.zwy.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zwy.domain.entity.Article;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author zwy
 * @version 1.0
 * @description: ArticleMapper
 * 文章持久层
 * @date 2025/9/19 11:19
 */
public interface ArticleMapper extends BaseMapper<Article> {
    @Select("select * from t_article where status = #{status} and is_deleted = 0 order by rand() limit #{limit}")
    List<Article> selectRandomArticles(@Param("status") Integer status,@Param("limit") Integer limit);
}
